import axios from 'axios';

const $http = axios.create({
    baseURL:"",
    timeout:10000
})

$http.interceptors.request.use(config=>{
    config.headers.token = sessionStorage.getItem("token");
    return config;
},error=>{
    return Promise.reject(error);
})

$http.interceptors.response.use(response=>{
    let data = response.data;
    return data;
},error=>{
    return Promise.reject(error);
})

export default $http;